<template>
  <div class="ref2son">
    <h1>这里是ref子组件</h1>
    <h1>子组件中要使用defineExpose暴露内容</h1>
  </div>
</template>
<script lang="ts" setup name='ref2son'>
import { ref, defineExpose, reactive } from "vue";
// 数据
let name = ref("张三");
let age = ref(18);
let person = reactive({ name: "李四", age: 16 });
let personTwo = ref({ name: "王五", age: 19 });
/****************************/
/****************************/
// 使用defineExpose将组件中的数据交给外部
defineExpose({ name, age, person,personTwo });
</script>
<style scoped>
.ref2son {
  width: 80vw;
  height: 80vh;
  border: 1px solid red;
}
</style>
